﻿using ExceptionDataStatisticsService.Service;
using Microsoft.Extensions.Logging;
using Quartz;

namespace IcIntegration.Job.Jobs
{
    public class ZrJobService : IJob
    {
        private readonly ILogger<ZrJobService> _logger;
        private readonly IServiceProvider _serviceProvider;

        public ZrJobService(
            IServiceProvider serviceProvider,
            ILogger<ZrJobService> logger)
        {
            _logger = logger;
            _serviceProvider = serviceProvider;
        }

        public async Task Execute(IJobExecutionContext context)
        {
            Console.WriteLine("ZrJobService:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            ExceptionDataService exceptionDataService = new ExceptionDataService(_serviceProvider, _logger);

            string[] equipmentList = new string[] { "25", "26", "27", "28", "29", "30", "31", "32" };
            exceptionDataService.ExceptionDataStatistics(this.GetType().Name, equipmentList);
        }
    }
}

